import SysDataApi from "../api/webPath/sysDataApi";

export function useSysDataList(type: string) {
  const enumList = ref([]);
  const pidList = ref([]);

  onMounted(async () => {
    const data = (await SysDataApi.getPageData({ type })).data;
    console.log("dic data", data);
    enumList.value = data?.map((x: any) => ({ value: x.name, label: x.name }));
    pidList.value = data?.map((x: any) => ({ value: x.name, pid: x.id}));
  });

  return { value: enumList, pid: pidList };
}
